import {Component, OnInit} from '@angular/core';
import {ActivatedRoute} from '@angular/router';

@Component({
  selector: 'app-detail2',
  templateUrl: './detail2.component.html',
  styleUrls: ['./detail2.component.scss']
})
export class Detail2Component implements OnInit {

  constructor(public route: ActivatedRoute) {
  }

  ngOnInit(): void {
    //动态路由获取url传值
    this.route.params.subscribe((data) => {
      console.log(data);
    });
  }

}
